package com.wysql.common.util;

public class Constants {

    /* 表格行点击列事件类型 */
    public static final Integer TO_TYPE_0 = 0;// 跳转
    public static final Integer DOWNLOAD_TYPE_1 = 1;// 下载
    public static final Integer TOP_TYPE_2 = 2;// 弹出页面
    public static final String DOWNLOAD_URL = "/xxwyspdwgh-ghsjgl/oss/download?download=";
    public static final String DOWNLOAD_WTK_URL_10kVPB = "/xxwyspdwgh-dwwtsl/dwwtslWtk10kvpb/download";
    public static final String DOWNLOAD_WTK_URL_10kVXL = "/xxwyspdwgh-dwwtsl/dwwtslWtk10kvxl/download";
    public static final String DOWNLOAD_BMD_URL_10kVPB = "/xxwyspdwgh-dwwtsl/dwwtslBmd10kvpb/download";
    public static final String DOWNLOAD_BMD_URL_10kVXL = "/xxwyspdwgh-dwwtsl/dwwtslBmd10kvxl/download";
    public static final String DOWNLOAD_WTXH_URL_10kVPB = "/xxwyspdwgh-dwwtsl/dwwtslWtxh10kvpb/download";
    public static final String DOWNLOAD_WTXH_URL_10kVXL = "/xxwyspdwgh-dwwtsl/dwwtslWtxh10kvxl/download";
    public static final String DOWNLOAD_URL_BXK = "/xxwyspdwgh-dwwtsl/dwzdBxk/download";
    public static final String DOWNLOAD_URL_WTK = "/xxwyspdwgh-dwwtsl/dwzdWtk/download";
    public static final String DOWNLOAD_URL_BMD = "/xxwyspdwgh-dwwtsl/dwzdBmd/download";
    public static final String DOWNLOAD_URL_WTXH = "/xxwyspdwgh-dwwtsl/dwzdWtxh/download";
    /* 电压等级 */
    public static final String DYDJ_URL = "/xxwyspdwgh-system/dict/getAllByRemark";

    private static final Integer ONE = 1;
    private static final Integer TWO = 2;
    private static final Integer THREE = 3;

    // prefix为自定义前缀，想要几位数可以自行修改0的数量
    // id获取方式为从数据库表中查询现在最大id+1（SELECT id+1  from table  ORDER BY id DESC LIMIT 1）
    public static String getXh(String prefix, Integer id) {
        //判断位数
        String s = id + "";
        int count = s.length();
        String producerNum = prefix;
        if (ONE == count) {
            producerNum += "000" + String.valueOf(id);
        } else if (TWO == count) {
            producerNum += "00" + String.valueOf(id);
        } else if (THREE == count) {
            producerNum += "0" + String.valueOf(id);
        } else {
            producerNum += String.valueOf(id);
        }
        return producerNum;
    }

}
